#include <iostream>
#include <string>
#include <vector>

using namespace std;
using ll = long long;
ll a[31][31];
int n;
int main()
{
    // * 杨辉三角是一道基础的动态规划题目，
    /*
    
    * 1. 推到动态转移方程
    * 2. 处理边界情况
    * 3. 移动方程
    */
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= n; j++)
        {
            if (i == j) a[i][j] = 1;
            else if (j > i) break;
            else a[i][j] = a[i - 1][j] + a[i - 1][j - 1];
            if (a[i][j]) printf("%5d", a[i][j]);
        }
        cout << endl;
    }
    return 0;
}